<?php !defined('DYHB_PATH') && exit; /* DoYouHaoBaby Framework 模板缓存文件 生成时间：2011-05-28 11:38:18  */ ?>
<?php $this->includeChildTemplate( "".APP_PATH."/Tpl/Default/public_header.html" ,"" ,"" ,"" )  ;?>

   <!-- 标题  -->
   <div class="title"><?php print G::L( "运行SQL 语句", null, null ) ; ?> ( <a href="<?php echo( G::U('backup/index') );?>"><?php print G::L( "数据库备份", null, null ) ; ?></a> | <a href="<?php echo( G::U('backup/restore') );?>"><?php print G::L( "数据库恢复", null, null ) ; ?></a> |<a href="<?php echo( G::U('backup/optimize') );?>"><?php print G::L( "数据库优化", null, null ) ; ?></a> )</div>

  <!-- 正文 -->
  <div id="content" class="content">
     <form method="post" action="" onsubmit="return validate()">
      <table class="form-table full">
          <tr>
              <th valign="top"><label for="sql"  class="field"><?php print G::L( "运行 SQL查询", null, null ) ; ?></label></td>
              <td><textarea name="sql" id="sql" rows="6" cols="80" class="field"><?php if(isset( $sSql )) :?><?php echo( $sSql ); ?><?php endif; ?></textarea>
              <div class="warning"><?php print G::L( "执行SQL将直接操作数据库，请谨慎使用", null, null ) ; ?></div></td>
            </tr>
          <tr>
              <th valign="top"><label for="button"  class="field"><?php print G::L( "优化操作", null, null ) ; ?> </label></td>
              <td><input type="submit" value="  <?php print G::L( "运行sql语句", null, null ) ; ?>   " class="button" />
              <div class="description"><?php print G::L( "及时清理数据库碎片，能够加快数据库查询速度", null, null ) ; ?></div>
              </td>
            </tr>

      </table>
      </form>
<script type="text/javascript">
function validate(){

  if( Dyhb.Dom.$('sql').value=='' ){

      dyhbAlert( D.L( 'SQL语句不能为空！') );
      return false;
  }

  return true;
}
//-->
</script>

      <?php if( isset( $nType ) && $nType==-1 ) :?>
      <div id="content_warning"><span style="color: rgb(255, 0, 0);"><strong><?php print G::L( "错误提示", null, null ) ; ?>：</strong></span><br />
      <?php echo( $sError ); ?></div>
      <?php elseif(  isset( $nType ) && $nType==1  ): ?>
      <div id="content_warning">
      <center><h3><?php print G::L( "执行成功", null, null ) ; ?></h3></center>
      </div>
      <?php elseif(  isset( $nType ) && $nType==2  ): ?>
        <?php echo( $sResult ); ?>
      <?php endif; ?>

   </div>
   <!-- end content -->

<?php $this->includeChildTemplate( "".APP_PATH."/Tpl/Default/public_footer.html" ,"" ,"" ,"" )  ;?>